<template>
  <div id="app">
   <Count />
   <hr>
   <MyHeader ref="HeaderComp"/>
  </div>
</template>

<script>
import Count from "./components/Count"
export default {
  name: 'App',
  components: {
 
    Count
  },
  methods:{
      /* 
        如果把ref属性写在一个组件上,那么$refs对象上保存的是组件实例
      */
    getRef(){
      console.log(this.$refs);
      console.log(this.$refs.HeaderComp);

    }
  }
}
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>
